#!/bin/bash 
# qemu-system-x86_64
# -name guest=centos-8.5.2111,debug-threads=on 
# -S 
# -object secret,id=masterKey0,format=raw,file=/var/lib/libvirt/qemu/domain-3-centos-8.5.2111/master-key.aes 
# -machine pc-q35-6.1,accel=kvm,usb=off,vmport=off,dump-guest-core=off,memory-backend=pc.ram 
# -cpu Skylake-Client-IBRS,ss=on,vmx=on,pdcm=on,hypervisor=on,tsc-adjust=on,clflushopt=on,umip=on,md-clear=on,stibp=on,arch-capabilities=on,ssbd=on,xsaves=on,pdpe1gb=on,ibpb=on,amd-stibp=on,amd-ssbd=on,rdctl-no=on,ibrs-all=on,skip-l1dfl-vmentry=on,mds-no=on,pschange-mc-no=on,hle=off,rtm=off
# -m 4096 
# -object memory-backend-ram,id=pc.ram,size=4294967296 
# -overcommit mem-lock=off 
# -smp 8,sockets=8,cores=1,threads=1 
# -uuid 730e15af-9603-4b6a-873c-a268a9a4f7b6 
# -no-user-config 
# -nodefaults 
# -chardev socket,id=charmonitor,fd=38,server,nowait 
# -mon chardev=charmonitor,id=monitor,mode=control 
# -rtc base=utc,driftfix=slew 
# -global kvm-pit.lost_tick_policy=delay 
# -no-hpet -no-shutdown 
# -global ICH9-LPC.disable_s3=1  
# -global ICH9-LPC.disable_s4=1 
# -boot strict=on 
# -device pcie-root-port,port=0x10,chassis=1,id=pci.1,bus=pcie.0,multifunction=on,addr=0x2 
# -device pcie-root-port,port=0x11,chassis=2,id=pci.2,bus=pcie.0,addr=0x2.0x1 
# -device pcie-root-port,port=0x12,chassis=3,id=pci.3,bus=pcie.0,addr=0x2.0x2 
# -device pcie-root-port,port=0x13,chassis=4,id=pci.4,bus=pcie.0,addr=0x2.0x3 
# -device pcie-root-port,port=0x14,chassis=5,id=pci.5,bus=pcie.0,addr=0x2.0x4 
# -device pcie-root-port,port=0x15,chassis=6,id=pci.6,bus=pcie.0,addr=0x2.0x5 
# -device pcie-root-port,port=0x16,chassis=7,id=pci.7,bus=pcie.0,addr=0x2.0x6 
# -device qemu-xhci,p2=15,p3=15,id=usb,bus=pci.2,addr=0x0 
# -device virtio-serial-pci,id=virtio-serial0,bus=pci.3,addr=0x0 
# -blockdev {"driver":"file","filename":"/home/qcow2-images/centos-8.5.2111.qcow2","node-name":"libvirt-2-storage","auto-read-only":true,"discard":"unmap"} 
# -blockdev {"node-name":"libvirt-2-format","read-only":false,"driver":"qcow2","file":"libvirt-2-storage","backing":null}
# -device virtio-blk-pci,bus=pci.4,addr=0x0,drive=libvirt-2-format,id=virtio-disk0,bootindex=1 
# -device ide-cd,bus=ide.0,id=sata0-0-0 
# -netdev tap,fd=40,id=hostnet0,vhost=on,vhostfd=41 
# -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:3e:07:72,bus=pci.1,addr=0x0 
# -chardev pty,id=charserial0 
# -device isa-serial,chardev=charserial0,id=serial0 
# -chardev socket,id=charchannel0,fd=42,server,nowait 
# -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 
# -chardev spicevmc,id=charchannel1,name=vdagent 
# -device virtserialport,bus=virtio-serial0.0,nr=2,chardev=charchannel1,id=channel1,name=com.redhat.spice.0 
# -device usb-tablet,id=input0,bus=usb.0,port=1 -spice port=5900,addr=127.0.0.1,disable-ticketing,image-compression=off,seamless-migration=on 
# -vnc 0.0.0.0:1 
# -device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vram64_size_mb=0,vgamem_mb=16,max_outputs=1,bus=pcie.0,addr=0x1 
# -device ich9-intel-hda,id=sound0,bus=pcie.0,addr=0x1b 
# -device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 
# -chardev spicevmc,id=charredir0,name=usbredir 
# -device usb-redir,chardev=charredir0,id=redir0,bus=usb.0,port=2 
# -chardev spicevmc,id=charredir1,name=usbredir 
# -device usb-redir,chardev=charredir1,id=redir1,bus=usb.0,port=3 
# -device virtio-balloon-pci,id=balloon0,bus=pci.5,addr=0x0 
# -object rng-random,id=objrng0,filename=/dev/urandom 
# -device virtio-rng-pci,rng=objrng0,id=rng0,bus=pci.6,addr=0x0 
# -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny 
# -msg timestamp=on

qemu-system-x86_64 -s -S \
	-name guest=centos-8.5.2111 \
	-m 2048 \
	-chardev stdio,id=gdb0 \
	-drive if=virtio,file=centos8.5.2111.qcow2,cache=none \
	-device isa-debugcon,iobase=0x402,chardev=gdb0,id=d1 \
	-vga virtio \
	-enable-kvm \
	-vnc 0.0.0.0:7 \
	-msg timestamp=on 
